import { ToolTipItem } from "../../../../com/mui/manager/ToolTipItem";
import { Language } from "../../../../extend/language/Language";
import { GameDefConfig } from "../../resource/GameDefConfig";
import { GModuleEvent } from "../../mvc/GModuleEvent";
import { Cache } from "../../cache/Cache";
import { LookupPlayerData } from "../player/LookupPlayerData";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
type int = number;
//class SpiritEquipGrayItem
    
    export  class SpiritEquipGrayItem extends ToolTipItem
    {
        constructor(arg1: int)
        {
            super();
            this._exType = arg1;
            return;
        }

        public set mode(arg1: string)
        {
            this._mode = arg1;
            return;
        }

        public set isGray(arg1: Boolean)
        {
            this._isGray = arg1;
            if (this._isGray) 
            {
                this.setCircle(28);
            }
            else 
            {
                this.setCircle(28, 0);
            }
            return;
        }

        public /* override */ get toolTipData()
        {
            var loc2=0;
            var loc3=null;
            var loc4=0;
            var loc6=false;
            var loc1=Language.getStringByParam(36652, GameDefConfig.instance.getSpiritEquipExTypeName(this._exType));
            var loc5="";
            var loc7=0;
            while (loc7 <= 7) 
            {
                loc2 = loc7;
                loc4 = 27 + (this._exType - 1) * 8 + loc2;
                loc3 = GameDefConfig.instance.getSpiritEquipName(this._exType, loc2);
                if (this._mode != GModuleEvent.Mode_Self) 
                {
                    loc6 = Cache.instance.spiritEquip.isHadEatByDressPos(loc4, LookupPlayerData.lookupData.mapSpiritEquipSuitSetInfo);
                }
                else 
                {
                    loc6 = Cache.instance.spiritEquip.isHadEatByDressPos(loc4);
                }
                if (loc6) 
                {
                    loc5 = "#FF00FF";
                }
                else 
                {
                    loc5 = "#7c7c7c";
                }
                loc1 = loc1 + (HTMLUtil.addColor(loc3, loc5) + "\n");
                ++loc7;
            }
            loc1 = "<textFormat leading=\'5\'>" + loc1 + "</textFormat>";
            return loc1;
        }

        /* internal  */setCircle(arg1: int, arg2: number=0.5): void
        {
            this.graphics.clear();
            this.graphics.beginFill(0, arg2);
            this.graphics.drawCircle(0, 0, arg1);
            this.graphics.endFill();
            this.cacheAsBitmap = true;
            return;
        }

        /* internal */ /* var */_isGray: Boolean;

        /* internal */ /* var */_exType: int;

        /* internal */ /* var */_mode: string;
    }
